var publicTpl = {

    _menu: $('.u_menu_container'),
    menu:
    `<ul class="u_menus">
        <li class="u_menu user-menu-active">
            <a href="javascript:0">
                <i class="fa fa-user-plus"></i>
                <span>我的菜单</span>
            </a>
        </li>
        <li class="u_menu">
            <a href="./../../index.html">
                <i class="fa fa-desktop"></i>
                <span>MDM</span>
            </a>
            <ul class="u_submenus">
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-cog"></i>
                        <span>权限管理</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000201.html">
                                <i class="fa fa-sitemap"></i>
                                <span>组织架构</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000101.html">
                                <i class="fa fa-user-plus"></i>
                                <span>员工数据</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002501.html">
                                <i class="fa fa-user"></i>
                                <span>角色定义</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002601.html">
                                <i class="fa fa-inbox"></i>
                                <span>权限定义</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM003201.html">
                                <i class="fa fa-users"></i>
                                <span>权限管理</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM005801.html">
                                <i class="fa fa-inbox"></i>
                                <span>审批阶段定义</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM005601.html">
                                <i class="fa fa-inbox"></i>
                                <span>审批流程</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-folder"></i>
                        <span>图片管理</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM001901.html">
                                <i class="fa fa-folder"></i>
                                <span>图片文件夹维护</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002001.html">
                                <i class="fa fa-cloud-upload"></i>
                                <span>图片上传</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-cubes"></i>
                        <span>产品</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus" style="width:220px;">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000301.html">
                                <i class="fa fa-code-fork"></i>
                                <span>产品分类</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002101.html">
                                <i class="fa fa-code"></i>
                                <span>物料主数据代码管理</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000401.html">
                                <i class="fa fa-cubes"></i>
                                <span>SKU主数据</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000601.html">
                                <i class="fa fa-dropbox"></i>
                                <span>品牌主数据</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000801.html">
                                <i class="fa fa-tags"></i>
                                <span>参数定义列表</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000901.html">
                                <i class="fa fa-cube"></i>
                                <span>规格表</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM004201.html">
                                <i class="fa fa-level-up"></i>
                                <span>物料上架记录单</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM004301.html">
                                <i class="fa fa-level-down"></i>
                                <span>物料下架记录单</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM006601.html">
                                <i class="fa fa-code-fork"></i>
                                <span>详情页分类主数据</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-group"></i>
                        <span>客户</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM001401.html">
                                <i class="fa fa-group"></i>
                                <span>客户主数据</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-registered"></i>
                        <span>供应商</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM000501.html">
                                <i class="fa fa-registered"></i>
                                <span>供应商主数据</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-money"></i>
                        <span>价格管理</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM001801.html">
                                <i class="fa fa-money"></i>
                                <span>价格清单主数据</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM004101.html">
                                <i class="fa fa-money"></i>
                                <span>价格调整单</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM006201.html">
                                <i class="fa fa-money"></i>
                                <span>采购价格调整单</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="./../../views/MDM/MDM003401.html">
                        <i class="fa fa-flag"></i>
                        <span>四级地址维护</span>
                    </a>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-flag"></i>
                        <span>仓库设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a> 
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002701.html">
                                <i class="fa fa-money"></i>
                                <span>仓库主数据</span>
                            </a>
                        </li>
                    </ul>                   
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-flag"></i>
                        <span>仓库设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a> 
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/MDM/MDM002701.html">
                                <i class="fa fa-money"></i>
                                <span>仓库主数据</span>
                            </a>
                        </li>
                    </ul>                   
                </li>
            </ul>
        </li>
        <li class="u_menu">
            <a href="./../../index.html">
                <i class="fa fa-cubes"></i>
                <span>OMS</span>
            </a>
            <ul class="u_submenus">
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-cubes"></i>
                        <span>销售订单</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        
                        <li class="u_submenu">
                            <a href="./../../views/OMS/OMS000106.html">
                                <i class="fa fa-cubes"></i>
                                <span>销售订单查询</span>
                            </a>
                        </li>

                        <li class="u_submenu">
                            <a href="./../../views/OMS/OMS000105.html">
                                <i class="fa fa-cubes"></i>
                                <span>取消订单审核</span>
                            </a>
                        </li>

                        <li class="u_submenu">
                            <a href="./../../views/OMS/OMS001201.html">
                                <i class="fa fa-cubes"></i>
                                <span>外部渠道订单</span>
                            </a>
                        </li>
                        
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-cubes"></i>
                        <span>发货通知单</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        
                    </ul>
                </li>
            </ul>
        </li>
        <li class="u_menu">
            <a href="./index.html">
                <i class="fa fa-group"></i>
                <span>CRM</span>
            </a>
            <ul class="u_submenus">
                <li class="u_submenu">
                    <a href="./../../views/CRM/CRM000201.html">
                        <i class="fa fa-group"></i>
                        <span>客户拜访记录</span>
                    </a>
                </li>
            </ul>
        </li>
        <li class="u_menu">
            <a href="./index.html">
                <i class="fa fa-database"></i>
                <span>WMS</span>
            </a>
        </li>
        <li class="u_menu">
            <a href="javascript:0">
                <i class="glyphicon glyphicon-globe"></i>
                <span>网站设置</span>
            </a>
            <ul class="u_submenus">
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-user"></i>
                        <span>网站用户数据</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                     <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM000701.html">
                                <i class="fa fa-user"></i>
                                <span>用户主数据</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM003301.html">
                                <i class="fa fa-user"></i>
                                <span>用户分类数据</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM005001.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>网站订单取消原因</span>
                    </a>
                </li>
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM005101.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>网站热搜词定义</span>
                    </a>
                </li>  
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM003501.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>主页内容设置</span>
                    </a>
                </li>  
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM003601.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>推荐商品设置</span>
                    </a>
                </li>
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM003801.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>精选品牌设置</span>
                    </a>
                </li>
                <li class="u_submenu">
                    <a href="./../../views/WZSZ/MDM004001.html">
                        <i class="glyphicon glyphicon-globe"></i>
                        <span>印染专区设置</span>
                    </a>
                </li> 
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-link"></i>
                        <span>新闻中心设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001101.html">
                                <i class="fa fa-file-text"></i>
                                <span>新闻中心类别</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001301.html">
                                <i class="fa fa-file-text"></i>
                                <span>新闻中心内容</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-link"></i>
                        <span>礼品中心设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM002201.html">
                                <i class="fa fa-gift"></i>
                                <span>礼品中心分类</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM002301.html">
                                <i class="fa fa-gift"></i>
                                <span>礼品中心内容</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-link"></i>
                        <span>帮助中心设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001601.html">
                                <i class="fa fa-server"></i>
                                <span>帮助中心类别</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001701.html">
                                <i class="fa fa-server"></i>
                                <span>帮助中心内容</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="u_submenu">
                    <a href="javascript:0">
                        <i class="fa fa-link"></i>
                        <span>技术中心设置</span>
                        <i class="fa fa-angle-right fa-2x"></i>
                    </a>
                    <ul class="u_submenus">
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001001.html">
                                <i class="fa fa-thumbs-up"></i>
                                <span>技术中心类别</span>
                            </a>
                        </li>
                        <li class="u_submenu">
                            <a href="./../../views/WZSZ/MDM001201.html">
                                <i class="fa fa-thumbs-up"></i>
                                <span>技术中心文章</span>
                            </a>
                        </li>
                    </ul>
                </li>               
            </ul>
        </li>
    </ul>`,
    menuInit: function(){
        this._menu.append(this.menu);
    },

    _userbar: $('.u_user'),
    userbar:
    `<ul class="u_toolgroup" style="float:right;margin-right:0;">
        <li class="u_tool" data-opt="user">
            <i class="fa fa-user"></i>
            <span>P0015</span>
        </li>
        <li class="u_tool" data-opt="sign_out">
            <i class="fa fa-sign-out"></i>
            <span>退出</span>
        </li>
    </ul>`,
    userbarInit: function(){
        this._userbar.append(this.userbar);
    }

}

publicTpl.menuInit();
publicTpl.userbarInit();
   



var WEB = {

	Toolbar: function(noPassword){
		if(noPassword == "noPassword"){
			var html = '';
		}else{
			var html = '<li class="u_tool" data-opt="password"><i class="fa fa-lock"></i><span>设置密码</span></li>';
		}
		var toolbar = $(".u_toolbar.u_full");
		toolbar&&toolbar.append(                  
		'<ul class="u_toolgroup"><li class="u_tool" data-opt="refresh"><i class="fa fa-refresh"></i><span>刷新</span></li><li class="u_tool" data-opt="add"><i class="fa fa-plus"></i><span>添加</span></li><li class="u_tool" data-opt="edit"><i class="fa fa-pencil"></i><span>编辑</span></li><li class="u_tool" data-opt="delete"><i class="fa fa-trash-o"></i><span>删除</span></li>'+html+'</ul><ul class="u_toolgroup u_search"><li class="u_tool" id="opt_search" data-opt="opt_search"><input type="text" value="" placeholder="搜索"/><i class="fa fa-search"></i></li></ul>'
		);
	},
	jstreeToolbar: function(){
		var jstreetoolbar = $(".u_toolbar.u_jstree");
		jstreetoolbar&&jstreetoolbar.append(
			'<ul class="u_toolgroup"><li class="u_tool" data-opt="new1"><i class="fa fa-plus"></i><span>新建同级分类</span>				</li>				<li class="u_tool" data-opt="new2">					<i class="fa fa-plus"></i>					<span>新建子级分类</span>				</li>				<li class="u_tool" data-opt="delete">					<i class="fa fa-trash-o"></i>					<span>删除</span>				</li>				<li class="u_tool" data-opt="save">					<i class="fa fa-save"></i>					<span>保存</span>				</li>			</ul>'	
		);
	},
	minToolbar: function(){
		var mintoolbar = $(".u_toolbar.u_mini");
		mintoolbar&&mintoolbar.append(
			'<ul class="u_toolgroup"><li class="u_tool" data-opt="new"><i class="fa fa-plus"></i><span>新建</span></li><li class="u_tool" data-opt="delete"><i class="fa fa-trash-o"></i><span>删除</span></li><li class="u_tool" data-opt="save"><i class="fa fa-save"></i><span>保存</span></li></ul>'
		);
	},
	userToolbar: function(){
		var userToolbar = $(".u_toolbar.u_user");
		userToolbar&&userToolbar.append(
			'<ul class="u_toolgroup" style="float:right;margin-right:0;"><li class="u_tool" data-opt="user"><i class="fa fa-user"></i><span>用户</span></li><li class="u_tool" data-opt="sign_out"><i class="fa fa-sign-out"></i><span>退出</span></li></ul>'
		);
	},

	Modal: function(modalTitle,modalInput,modalSelect,modalButton){
		var inputs = '';
		for(var i=0;i<modalInput.length;i++){
			inputs += '<div class="form-group"><label>'+modalInput[i].text+'</label><input type="text" class="form-control" '+modalInput[i].state+' placeholder="'+modalInput[i].text+'" name="'+modalInput[i].name+'"></div>';
		}
		$(".modal-content").html(
			'<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="myModalLabel">'+modalTitle+'</h4></div>'+
			'<div class="modal-body">'+inputs+modalSelect+'<div class="alert alert-danger" role="alert"><span class="fa fa-exclamation"></span><span class="alert-text">ERROR</span></div></div>'+
			'<div class="modal-footer"><button type="button" class="btn btn-default" id="'+modalButton.id+'">'+modalButton.yes+'</button><button type="button" class="btn btn-default" data-dismiss="modal">'+modalButton.no+'</button><span class="scale-icon"></span></div>'
		);
		$("#Modal").modal({backdrop : 'static'});
		ACTION.Modal();
	},
	alertModal: function(modalIcon,modalTitle,modalMessage){
		$(".modal-content").html(
			'<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="myModalLabel"><span class="fa fa-'+modalIcon+'"></span>&nbsp;'+modalTitle+'</h4></div>'+
			'<div class="modal-body"><p class="text-center">'+modalMessage+'</p></div>'+
			'<div class="modal-footer"><button type="button" class="btn btn-default center-block" data-dismiss="modal">关闭</button><span class="scale-icon"></span></div>'
		);
		$("#Modal").modal({backdrop : 'static'});
		ACTION.Modal();
	},

	test: 'hello, test success'

}
